#! /bin/sh -vx
# $Id$
# Copyright 2017 Karl Berry <tex-live@tug.org>
# Copyright 2009-2014 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.

BinDir=${BinDir:-.}
ExeExt=${ExeExt:-}
_wofm2opl=$BinDir/wofm2opl$ExeExt
_wopl2ofm=$BinDir/wopl2ofm$ExeExt
_wovf2ovp=$BinDir/wovf2ovp$ExeExt
_wovp2ovf=$BinDir/wovp2ovf$ExeExt

tests=omegaware/tests

test -d $tests || mkdir -p $tests
rc=0

TEXMFCNF=$srcdir/../kpathsea \
  OFMFONTS=./$tests \
  $_wovp2ovf -verbose $srcdir/$tests/specialhex $tests/specialhex $tests/specialhex || rc=1

TEXMFCNF=$srcdir/../kpathsea \
  $_wofm2opl -verbose $tests/specialhex $tests/specialhex || rc=2

$_wopl2ofm -verbose $tests/specialhex $tests/xspecialhex || rc=3

TEXMFCNF=$srcdir/../kpathsea \
  $_wofm2opl -verbose $tests/xspecialhex $tests/xspecialhex || rc=4

diff $tests/specialhex.opl $tests/xspecialhex.opl || rc=5

TEXMFCNF=$srcdir/../kpathsea \
  OFMFONTS=".;./$tests" \
  $_wovf2ovp -verbose $tests/specialhex $tests/specialhex $tests/xspecialhex || rc=6

diff $srcdir/$tests/specialhex.ovp $tests/xspecialhex.ovp || rc=7

exit $rc
